#include <iostream>

class Base {
	virtual void test() { std::cout << "Base::test()" << std::endl; }
public:
	Base() { test(); }
	virtual ~Base() { test(); }
};

class Derived : public Base {
	virtual void test() { std::cout << "Derived::test()" << std::endl; }
public:
	Derived() { test(); }
	~Derived() { test(); }
};